/**
 * Created by youngpan on 2017/1/6.
 */


require.config({
    baseUrl: 'src',
    urlArgs: 'v=' + (new Date()).getTime() + Math.random() * 10000,
    paths: {
        'angular': 'vendor/angular',
        'angularAMD': 'vendor/angularAMD',
        'angularRoute': 'vendor/angular-route',
        'angularSanitize': 'vendor/angular-sanitize.min',
        'app': 'main/app'
    },
    shim: {
        'angular': {
            exports: "angular"
        },
        'angularAMD': {
            deps: ['angular'],
            exports: "angularAMD"
        },
        'angularRoute': {
            deps: ['angular'],
            exports: "angularRoute"
        },
        'angularSanitize': {
            deps: ['angular'],
            exports: "angularSanitize"
        }
    },
    deps: ['app']
});


//加载路由。
require(['main/route'
], function () {
    console.log("成功加载路由");
});


(function () {
    function setFontsize() {
        var html = document.documentElement;
        var fontSize,
            bWidth,
            screenWidth = html.clientWidth;
        if (html.getBoundingClientRect) {
            bWidth = html.getBoundingClientRect().width;
        } else {
            bWidth = screenWidth;
        }
        fontSize = bWidth * 100 / 375;
        window.bodyWidth = bWidth;

        html.style.fontSize = fontSize.toFixed(3) + "px";
    }

    window.setFontsize = setFontsize;
    var eventName = 'orientationchange' in window ? 'orientationchange' : 'resize';
    window.addEventListener(eventName, setFontsize);
    setFontsize();
})();

//以是否有横屏监听来判断是否再手机端。可以省略。




